package leetcode.com.cj.day01;

import java.util.Scanner;

/**
 * @description:https://mp.weixin.qq.com/s/WgcGqoDsGz8L_aiFgYvUDg 京东
 * @author：ziyu，微信：coajie60
 * @date: 2023-08-13
 * @Copyright： 博客：https://www.ziyus.cn
 * 第一题: 枚举 - LeetCode 中等
 *
 * 题目提交网址:https://codefun2000.com/p/P1446
 *
 * 第二题: 动态规划 - LeetCode 中等
 *
 * 题目提交网址:https://codefun2000.com/p/P1447
 *
 * 第三题: 枚举 - LeetCode 困难
 *
 * 题目提交网址:https://codefun2000.com/p/P1448
 */
public class Main {

    public static void main(String[] args) {
        Main main = new Main();
        main.test2();
        int a = 1;
    }

    public void test1(){

        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        sc.nextLine();
        String str = sc.nextLine();

        int res = n;
        for (int i = 0; i < n; i++) {
            int l = 0;
            int r = str.length()-1;
            int current = i;
            while(l<r){
                if(str.charAt(l)!=str.charAt(r)){
                    current++;
                }
                l++;
                r--;
            }
            res = Math.min(res,current);
            str = str.substring(1,str.length())+str.substring(0,1);
        }
        System.out.print(res);
    }

    public void test2(){
        int MOD = (int) 1e9 + 7;
        Scanner scanner = new Scanner(System.in);
        int n = scanner.nextInt();
        scanner.nextLine();
        int[] arr = new int[n];
        for (int i = 0; i < n; i++) {
            arr[i] = scanner.nextInt();
        }
        int[] dp = new int[10];
        if(n==1){
            if(arr[0]<10){
                dp[arr[0]] = 1;
            }
            for (int i = 0; i < 10; i++) {
                System.out.println(dp[i]);
            }
            return;
        }
        dp[arr[n-1]%10] = 1;

        n--;
        while(n>0){
            int num = arr[n-1]%10;
            n--;
            int ndp[] = new int[10];
            for (int i = 0; i < 10; i++) {
                ndp[(i+num)%10]+=dp[i];
                ndp[(i+num)%10]%=MOD;

                ndp[(i*num)%10]+=dp[i];
                ndp[(i*num)%10]%=MOD;

            }
            dp = ndp;
        }
        for (int i = 0; i < 10; i++) {
            System.out.println(dp[i]);
        }
    }
}
